<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title>能量逗优惠券</title>
    <link rel="stylesheet" href="http://api.nldou.com/html/css/framework7.ios.min.css">
    <style>
        .navbar {background: transparent;} .navbar:after{height:0;}
        .list-block ul:before,.list-block ul:after{height:0;}
        .promocard-result {
            position: relative;
            padding: 20px 40px 0;
            background: #ffdeb7 url(/html/img/coupon_bg.jpg) center center no-repeat;
        }
        .coupon-container {
            position: relative;
            background-color: #fd5c4b;
            border-top-left-radius: 5px;
            border-top-right-radius: 5px;
            padding: 16px 0 65px;
            max-width: 280px;
            margin: 0 auto;
        }
        .coupon-container::before {
            content: ' ';
            display: inline-block;
            width: 8px;
            height: 8px;
            border-radius: 8px;
            position: absolute;
            top: 5px;
            left: 5px;
            background-color: #ffebd4;
        }
        .coupon-container::after {
            content: ' ';
            display: inline-block;
            width: 8px;
            height: 8px;
            border-radius: 8px;
            position: absolute;
            top: 5px;
            right: 5px;
            background-color: #ffebd4;
        }
        .coupon-mini {
            position: relative;
            margin: 0 auto 5px;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            background: transparent url(/html/img/coupon_mini_bg.png) left top no-repeat;
            width: 214px;
            height: 89px;
            padding: 6px 8px 0;
        }
        .coupon-mini .coupon-type {
            width: 1em;
            height: 75px;
            padding: 6px 10px;
            top: 0;
            left: 8px;
            color: #8b8b8b;
            display: table-cell;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            text-align: center;
            vertical-align: middle;
        }
        .coupon-mini .coupon-info {
            position: absolute;
            left: 64px;
            top: 6px;
            width: 50%;
            font-size: 12px;
            color: #999;
            padding-top: 11px;
        }
        .coupon-value{font-size: 18px;font-weight: bold;color: #FF0000;text-align: center;}
        .coupon-result{text-align: center;margin-top: 3px;}
        .coupon-actions {
            padding: 20px 18px 0;
        }
        .btn {
            width: 100%;
            padding: 11px 10px;
            font-size: 16px;
            line-height: 16px;
            border-radius: 4px;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            text-align: center;
            display: inline-block;
            margin: 0;
            -webkit-appearance: none;
            border: 1px solid #e5e5e5;
            background-color: #fff889;
            color: #161616;
            margin-bottom: 15px;
            -webkit-transition: all 0.2s ease-out;
            -moz-transition: all 0.2s ease-out;
            transition: all 0.2s ease-out;
        }
        .cloud {
            position: absolute;
            left: 0;
            bottom: 0;
            display: block;
            width: 100%;
            height: 68px;
            background: transparent url(/html/img/cloud.png) center bottom no-repeat;
            z-index: 2;
        }
        .promocard-others {
            padding: 0 10px 0;
        }
        .line-block::before {
            border-top: 1px solid #eee;
            content: '';
            display: block;
            margin: 10px;
        }
        .lineblock-content {
            display: block;
            text-align: center;
            margin-top: -17px;
            margin-bottom: 17px;
            line-height: 14px
        }
        .lineblock-font {
            background-color: #fff;
            color: #999;
            display: inline-block;
            padding: 0 10px;
        }
        .lineblock-desc{
            padding: 0 15px;
            font-size: 12px;
            line-height: 1.4em;
            text-align: left;
            color: #999;}
    </style>
</head>
<body>
<div class="statusbar-overlay"></div>
<div class="views">
    <div class="view view-main">
        <div class="navbar">
            <div class="navbar-inner"></div>
        </div>
        <div class="pages navbar-through">
            <div data-page="Coupon" id="Coupon" class="page" style="background: #FFFFFF;">
                <div class="page-content" style="padding: 0;">
                    <div class="promocard-result">
                        <div class="coupon-container">
                            <div class="coupon-mini">
                                <div class="coupon-type">优惠券</div>
                                <div class="coupon-info">
                                    <div class="coupon-value"><?php echo $value;?>元</div>
                                    <div class="coupon-result"><?php if ($status==1):?>领取成功<?php else:?>领取失败<?php endif;?></div>
                                </div>
                            </div>
                            <div class="coupon-actions">
                                <a href="<?php echo $url;?>" class="btn external">进店下单</a>
                            </div>
                        </div>
                        <div class="cloud"></div>
                    </div>
                    <div class="promocard-others">
                        <div class="line-block">
                            <div class="lineblock-content">
                                <span class="lineblock-font"><?php if ($status==1):?>使用说明<?php else:?>失败原因<?php endif;?></span>
                                <p class="lineblock-desc">
                                    <?php if ($status==1):?>
                                        <?php echo $coupon['description'];?>
                                    <?php else:?>
                                        <?php echo $msg;?>
                                    <?php endif;?>
                                </p>
                                <div><img src="/html/img/nldou-logo.jpg" style="width: 128px;margin: 0 auto;"></div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="/html/js/wx.jssdk.min.1.2.0.js"></script>
<script type="text/javascript" src="/html/js/framework7.min.js"></script>
<script type="text/javascript">
    var $$ = Dom7;
    var Shareimg_url = "http://wap.nldou.com/img/nldou-bg.jpg";
    $$.ajax({
        url:'http://api.nldou.com/weixinapi/init_wx_jsapi',
        method:"GET",
        data: {fromUrl:window.location.href},
        dataType:'json',
        success: function (res) {
            if(res.code==1){
                wx.config({
                    debug: false,
                    appId: res.data.appid,
                    timestamp: res.data.timestamp,
                    nonceStr: res.data.nonceStr,
                    signature: res.data.signature,
                    jsApiList: ['onMenuShareTimeline','onMenuShareAppMessage','hideMenuItems']
                });
            }
        }
    });
    wx.ready(function () {
        wx.hideMenuItems({
            menuList: ['menuItem:share:qq', 'menuItem:share:weiboApp', 'menuItem:share:facebook', 'menuItem:share:QZone',
                'menuItem:copyUrl', 'menuItem:openWithQQBrowser', 'menuItem:openWithSafari']
        });
        wx.onMenuShareTimeline({
            title: '点击领取<?php echo $value;?>元优惠券',
            link: '<?php echo $shareurl;?>',
            imgUrl: Shareimg_url,
            success: function () {}
        });
        wx.onMenuShareAppMessage({
            title: '点击领取<?php echo $value;?>元优惠券',
            desc: '能量逗益智家庭桌游，快乐教育，与孩子共同成长',
            link: '<?php echo $shareurl;?>',
            imgUrl: Shareimg_url,
            type: 'link',
            success: function () {}
        });
    });
    <?php if ($status==1):?>
    var app = new Framework7();
    app.modal({
        title:"领取成功，3s后自动跳转商城",
        text:"<div class='progressbar-infinite'></div>"
    });
    setTimeout(function () {
        window.location.href="<?php echo $url;?>";
    },3000);
    <?php endif;?>
</script>
</body>
</html>